package com.example.deeplearningjavafrombug.container.lesson1;

import java.util.ArrayList;
import java.util.List;

public class Client {

    private static final List<Shop> shops = new ArrayList<>();

    public static void main(String[] args) {
        init();
        check();
    }

    private static void init() {
        Shop bookShop = new Shop(Product.BOOK);
        Shop clothesShop = new Shop(Product.CLOTHES);
        Shop shoesShop = new Shop(Product.SHOES);
        shops.add(bookShop);
        shops.add(clothesShop);
        shops.add(shoesShop);
        System.out.println("shops initialization completed: " + shops);
    }

    private static void check() {
        System.out.println("Before contains check: " + shops);
        Shop bookShop = new Shop(Product.BOOK);
        boolean isBookShopExists = shops.contains(bookShop);
        System.out.println("After contains check: " + shops);
        if (isBookShopExists) {
            System.out.println("There's a book shop.");
        } else {
            System.out.println("There's no book shop.");
        }
    }

}
